PROGS = wii-fsck
COMMON = boot2.o boot1.o nand.o nandfs.o sha1.o rijndael.o md5.o 
COMMON += my_getopt.o tools.o bn.o ecc.o fs_hmac.o titles.o shared1.o
COMMON += uid.o iplsave.o
DEFINES = -DLARGE_FILES -D_FILE_OFFSET_BITS=64
LIBS =

CC = gcc
CFLAGS = -Wall -W -g -O0
LDFLAGS =


OBJS = $(patsubst %,%.o,$(PROGS)) $(COMMON)

all: $(PROGS)

*.o: *.h

$(PROGS): %: %.o $(COMMON) Makefile
	$(CC) $(CFLAGS) $(LDFLAGS) $< $(COMMON) $(LIBS) -o $@

$(OBJS): %.o: %.c tools.h Makefile
	$(CC) $(CFLAGS) $(DEFINES) -c $< -o $@

clean:
	-rm -f $(OBJS) $(PROGS)
